// do ajax
function submitClick(Dialog) {
	$(".submitButton").click(function() {

		// defined a new object from the form
		var MyData = new Object();
		// get the result
		$(".key_Label").each(function() {
			var key = $(this).html();
			eval("MyData." + key + "=new Array();");
			MyData[key] = new Array();
			$("." + key).each(function() {
				MyData[key][MyData[key].length] = $(this).val();
			});
		});

		var strdata = JSON.stringify(MyData);

		// do ajax

		var ajaxfun = new AjaxProcess(Dialog, MyData);
		ajaxfun.doAjax();
	});
}

function forLinkReview() {
	var key = request("key");
	var url = request("Url");
	
	if (key == "link_review" && (url != undefined && url != "")) {
		
		$("#link").val(url);
	}
}

// main function
$(function() {
	var key = request("key");
	var view = AppData[key].page.view;
	var ajaxOpt = AppData[key].page.ajax;
	createHTML(view, $("body"));// depend on appdata
	initialInput();
	forLinkReview();
});
